﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Templates_Item_Default : Acms.AcmsControls.TemplatePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DataBind();
        }
    }

    public override void DataBind()
    {
        if (AcmsContext.CurrentPost != null && AcmsContext.CurrentPost.Parent != null)
        {
            lnkBack.NavigateUrl = AcmsContext.CurrentPost.Parent.Url;
            lnkBack.Text = string.Format("Back to {0} Product Overview", AcmsContext.CurrentPost.Parent.DisplayName);
            //lnkThumb.FileId = AcmsContext.CurrentPost.Parent.ThumbnailId; 
            imgkThumb.FileId = AcmsContext.CurrentPost.Parent.ThumbnailId; 
        }
        else
        {
            lnkBack.NavigateUrl = AcmsContext.GetUrl("#");
            lnkBack.Text = string.Format("Back to {0} Product Overview", "Parent");
            //lnkThumb.FileId = -1;
        }
        base.DataBind();
    }
}
